﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Reflection;

namespace TerenXNA
{
    public static class TKolor
    {
        static Color[] kolor2;

        public static void loadBitmaps()
        {
            System.Drawing.Bitmap MyBitmap = new System.Drawing.Bitmap("paleta1.bmp");
            kolor2 = new Color[MyBitmap.Width];

            for (int i = 0; i < MyBitmap.Width; i++)
            {
                kolor2[i].R = MyBitmap.GetPixel(i, 0).R;
                kolor2[i].G = MyBitmap.GetPixel(i, 0).G;
                kolor2[i].B = MyBitmap.GetPixel(i, 0).B;
            }

        }

        public static Color generujKolor1(float h)
        {
            int kolorr = 0;
            kolorr = (int)(h + 50);
            return new Color(kolorr, kolorr, kolorr);
        }

        public static Color generujKolor2(float h)
        {
            int offset = 10;
            int min = 200;

            //h = h % 25;
            
            for (int i = 0; i < 25; i++)
            {
                if (h > min && h <= min + offset) return kolor2[i];
                min -= offset;
            }

            return kolor2[0];
        }

    }
}
